package crm.util;

import javax.swing.JDialog;
import javax.swing.JProgressBar;
import javax.swing.WindowConstants;

import crm.view.ClassRoomManagerGUI;


public class LoadingDialog {

	public LoadingDialog() {

	}
	private static JDialog lDialog;
	static {
		lDialog = new JDialog();
		JProgressBar lPBar = new JProgressBar();
		lPBar.setStringPainted(true);
		lPBar.setString("loading");
		lPBar.setIndeterminate(true);
		lDialog.setContentPane(lPBar);
		lDialog.setUndecorated(true);
		lDialog.setSize(300,50);
		lDialog.setAlwaysOnTop(true);
		lDialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

	}
	public static void show(ClassRoomManagerGUI gui){
		lDialog.setLocationRelativeTo(gui);
		lDialog.setVisible(true);

	}
	public static void dispose(){
		lDialog.dispose();
	}
}
